package cc.mrbird.unit.service;

import cc.mrbird.common.domain.QueryRequest;
import cc.mrbird.system.domain.User;
import cc.mrbird.unit.domain.UnitInfo;
import cc.mrbird.unit.domain.UnitType;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

@CacheConfig(cacheNames = "UnitInfoService")
public interface UnitInfoService {

    List<UnitInfo> findUnitInfoWithType(UnitInfo unitInfo, QueryRequest request);

    UnitInfo findByName(String unit_name);
    @CacheEvict(allEntries = true)
    void add(UnitInfo unitInfo,User user);
    @CacheEvict(key = "#p0", allEntries = true)
    void update(UnitInfo unitInfo);
    @CacheEvict(key = "#p0", allEntries = true)
    void delete(String ids);

    UnitInfo findById(Long id);


    boolean batchImport(String fileName, MultipartFile file) throws Exception;
}
